from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from .models import Product, Category, SubCategory, ProductType

@receiver([post_save, post_delete], sender=Product)
def product_changed(sender, instance, **kwargs):
    """商品数据变更时的处理函数"""
    # 不再需要清除缓存
    pass

@receiver([post_save, post_delete], sender=Category)
def category_changed(sender, instance, **kwargs):
    """分类数据变更时的处理函数"""
    # 不再需要清除缓存
    pass

@receiver([post_save, post_delete], sender=SubCategory)
def subcategory_changed(sender, instance, **kwargs):
    """子分类数据变更时的处理函数"""
    # 不再需要清除缓存
    pass

@receiver([post_save, post_delete], sender=ProductType)
def product_type_changed(sender, instance, **kwargs):
    """商品类型数据变更时的处理函数"""
    # 不再需要清除缓存
    pass 